<cfsilent>
	<cfscript>
		objTransfer = Event.getValue("objTransfer");
		
		/* getUserAttempts Trial */
		objectUser = objTransfer.get("user.user",1);
		//display all attempts by a user
		qUserAttempts = rc.Transfer.listByProperty("exam.attempt","user_id",1);
		
		objectUserAttempt = objTransfer.new("exam.attempt");
		stArguments = structNew();	
		stArguments.username = "felix";
		stArguments.password = "password";
		qUser = rc.Transfer.readByPropertyMap("user.user", stArguments);
		userBean = qUser;
		attemptIterator = userBean.getAttemptIterator();
		//examIterator = userBean.getExamsIterator();
	</cfscript>
</cfsilent>
<cfoutput>
	User ID = #qUser.getUser_ID()# <br />
	User Dump: <cfdump var="#qUser#">
	<cfloop condition="attemptIterator.hasNext()">
		<cfset oAttempt = attemptIterator.Next()>
		<cfset stAttemptQuestions = oAttempt.getattempt_questionStruct()>
		<cfloop collection="#stAttemptQuestions#" item="item">
			<cfset oAttemptQuestion = StructFind( stAttemptQuestions, item )>
			<cfset oQuestion = oAttemptQuestion.getParentQuestion()>
			
			Da question : #oQuestion.getQuestion()# 
		</cfloop>
	</cfloop>
	<cfabort>
	<cfdump var="#Event.getValue('objTransfer')#">
	<cfdump var="#objAttempt#">
	<br />
	To display the power of many to many in Transfer, I need to, being supplied with an attempt_id find out all the question ids 
	for the question: <br />
	<cfloop condition="questions.hasNext()">
		<cfset objQuestion = questions.Next()>
		<cfset answers = objQuestion.getAnswersIterator()>
		#objQuestion.getQuestion_id()#. #objQuestion.getQuestion()# <br />
		<cfloop condition="#answers.hasNext()#">
			<cfset answer = answers.Next()>
			#answer.getAnswer()# is #IIF(answer.getIs_correct(),DE("correct"),DE("incorrect"))# <br />
		</cfloop>
	</cfloop>
</cfoutput>